<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div>
    <p>
        <a href="#">百度</a>
    </p>
    <a href="#">腾讯</a>
    <p>abc</p>
</div>
<script>
var div = document.querySelector("div");
// 包括任何类型的, 元素, 文本, 注释
var allNodes = div.childNodes;
for(var node of allNodes){
    if(node.nodeType == 1){
        console.log(node);
    }
    
}

/*
console.log(allNodes);
var first = div.firstChild;
console.log(first.nodeType);
console.log(div.lastChild);

console.log(first.nextSibling.nextSibling);
console.log(first.nextSibling.previousSibling == first);

console.log(first.parentNode);
*/

</script>
</body>
</html>